package com.hongyue.dey01;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

public class Demo {
    public static void main(String[] args) throws ParseException {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入您的出生时间(1990-01-01 01:01:01)");
        String a = sc.nextLine();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date pa = sdf.parse(a);
        long time = pa.getTime();
        long l = System.currentTimeMillis();
        long l1 = (l - time) / (1000L * 60 * 60 * 24);
        System.out.println("您一共活了" + l1 + "天");
    }
}
